Enable Glagol support by translating slashes in identifiers to dots #136
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a patch which allows for compatibility with Glagol, a clever little live coding framework that I've been working on for the last few months. One of its main features actually originated from this very hack; turns out that replacing slashes with dots allows
(./foo/bar baz)
to be translated to_.foo.bar(baz)
rather than the nonsensical_.foo/bar(baz)
. This is not only more consistent with how namespaces are currently handled in Wisp, but, in Glagol, allows you to use a path-like syntax to get the values of neighboring files (which are helpfully provided by Glagol in a_
global object.)I understand that this is a somewhat weird feature and not consistent with the Clojure side of things (AFAIK Clojure does not support anything like nested namespaces). Still, I consider it beneficial to contribute this to upstream, so that Glagol can support Wisp out-of-the-box without having to maintain a patched fork. (I actually tried monkeypatching the writer at runtime -- but, within the writer module, the original
var
reference to the unpatched function was preserved, so it didn't work).I have also fixed an assumed typo in the docstring for
translate-identifier-word
.